<div id="divInformacionPersonal">
	<g:set var="graboOk" value="${result.toBoolean() }" ></g:set>
	<div id="errors">
		<g:if test="${graboOk}">
			<button type="button" class="close" data-dismiss="alert">&times;</button>
			<div class="alert alert-success">Se grab&oacute; todo ok!</div>
		</g:if>
		<g:else>
			<g:hasErrors bean="${personInstance}">
				<g:eachError bean="${personInstance}" var="error">
					<div class="alert alert-error" style="margin-bottom: 5px;">
						<button type="button" class="close" data-dismiss="alert">&times;</button>
						<g:message error="${error}"/>
					</div>
				</g:eachError>
			</g:hasErrors>
		</g:else>
	</div>
	<g:form id="formPerson" name="formPerson" controller="perfil" action="modificarInformacionPersonal">
	<g:hiddenField name="personInstanceId" id="personInstanceId" value="${personInstance?.id}" />
		<div id="precio">
			<div class="span8">
				<div class="row-fluid">
					<div class="control-group span6 ${hasErrors(bean: personInstance, field: 'nombre', 'error') }">
						<label class="control-label" for="nombre">Nombre:</label>
						<div class="controls">
							<g:textField class="span12" id="nombre" value="${personInstance?.nombre}" name="nombre" maxLength="100"/>
						</div>
					</div>
					
					<div class="control-group span6 ${hasErrors(bean: personInstance, field: 'apellido', 'error') }">
						<label class="control-label" for="apellido">Apellido:</label>
						<div class="controls">
							<g:textField class="span12" id="apellido" value="${personInstance?.apellido}" name="apellido" maxLength="100"/>
						</div>
					</div>
				</div>
				
				<div class="control-group ${hasErrors(bean: personInstance, field: 'email', 'error') }">
					<label class="control-label" for="email">Email:</label>
					<div class="controls">
						<div class="input-prepend">
							<span class="add-on">@</span>
							<g:textField class="span4" id="email" value="${personInstance?.email}" name="email"/>
						</div>
					</div>
				</div>
				
				<div class="control-group ${hasErrors(bean: personInstance, field: 'telefono', 'error') }">
					<label class="control-label" for="telefono">Tel&eacute;fono:</label>
					<div class="controls">
						<g:textField class="span5" id="telefono" value="${personInstance?.telefono}" name="telefono" maxLength="20"/>
					</div>
				</div>
				
				<div class="row-fluid">
					<div class="control-group span4 ${hasErrors(bean: personInstance, field: 'anioNacimiento', 'error') }">
						<label class="control-label" for="anioNacimiento">A&ntilde;o de nacimiento:</label>
						<div class="controls">
							<g:select name="anioNacimiento" from="${1910..(Calendar.instance.get(Calendar.YEAR)-18)}" value="${personInstance?.anioNacimiento}" id="anioNacimiento" class="span12"/>
						</div>
					</div>
					
					<div class="control-group span4 ${hasErrors(bean: personInstance, field: 'documento', 'error') }">
						<label class="control-label" for="documento">Documento:</label>
						<div class="controls">
							<g:textField class="span12" id="documento" value="${personInstance?.documento}" name="documento" maxLength="20"/>
						</div>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="telefono">Direcci&oacute;n de partida predefinida:</label>
					<div class="controls">
						<div class="input-prepend">
							<span class="add-on"><i class="icon-map-marker"></i></span>
							<g:textField name="direccion" id="direccion" type="text" class="span6"
								maxLength="60" placeholder="Escriba la direccion de partida"
								value="${personInstance?.casa?.direccion}" />
						</div>
						<g:hiddenField name="locationDireccion" id="locationDireccion" type="text" data-geoOrigen="location" />
					</div>
					
					
				</div>
				
<%--				<div class="input-prepend span7 noLeft">--%>
<%--					<label class="control-label" for="nombre">Nombre</label>--%>
<%--					<g:textField class="span3" id="nombre" value="${personInstance?.nombre}" name="nombre" maxLength="100"/>--%>
<%--				</div>--%>
<%--				<div class="separator"></div>--%>
<%--				<div class="input-prepend span4 noLeft">--%>
<%--					<label class="control-label" for="apellido">Apellido</label>--%>
<%--					<g:textField class="span3" id="apellido" value="${personInstance?.apellido}" name="apellido" maxLength="100"/>--%>
<%--				</div>--%>
<%--				<div class="separator"></div>--%>
<%--				<div class="input-prepend span4 noLeft">--%>
<%--					<label class="control-label" for="banco">Email</label>--%>
<%--					<g:textField class="span4" id="email" value="${personInstance?.email}" name="email"/>--%>
<%--				</div>--%>
<%--				<div class="separator"></div>--%>
<%--				<div class="input-prepend span4 noLeft">--%>
<%--					<label class="control-label" for="banco">Tel&eacute;fono</label>--%>
<%--					<g:textField class="span3" id="telefono" value="${personInstance?.telefono}" name="telefono"/>--%>
<%--				</div>--%>
<%--				<div class="separator"></div>--%>
<%--				<div class="input-prepend span4 noLeft">--%>
<%--					<label class="control-label" for="banco">A&ntilde;o de nacimiento</label>--%>
<%--					<g:select name="anioNacimiento" from="${1910..(Calendar.instance.get(Calendar.YEAR)-18)}" value="${personInstance?.anioNacimiento}" id="anioNacimiento" class="span2"/>--%>
<%--				</div>--%>
<%--				<div class="separator"></div>--%>
<%--				<div class="input-prepend span4 noLeft">--%>
<%--					<label class="control-label" for="documento">Documento</label>--%>
<%--					<g:textField class="span2" id="documento" value="${personInstance?.documento}" name="documento" maxLength="50"/>--%>
<%--				</div>--%>
<%--				<div class="separator"></div>--%>
			</div>
			<div class="separator"></div>
			<div align="center">
				<g:submitToRemote class="btn btn-primary btn-large span2 centrar" id="btnGuardarCuenta" name="btnGuardarCuenta" controller="perfil" action="actualizarInformacionPersonal" update="divInformacionPersonal" value="Guardar" />
			</div>
		</div>
	</g:form>
</div>